// Copyright (c) 2002 Cunningham & Cunningham, Inc.
// Released under the terms of the GNU General Public License version 2 or later.

package fat
{

import com.fit4as.fit.Parse;
import com.fit4as.fit.Fixture;

public class Table extends Fixture {
    public static var table : Parse;

    override public function doRows(rows : Parse) : void {
        Table.table = Parse.createParseFromStrings("table", null, copy(rows), null);
        // evaluate the rest of the table like a runner
        (new Fixture()).doTables(Table.table);
    }

    private static function copy(tree : Parse) : Parse {
        // if (2+2==4)return tree;
        return (tree == null)
                ? null
                : Parse.createParseFromStrings(tree.tag, tree.body, copy(tree.parts), copy(tree.more));
    }
}
}